home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.2 KB | 47 lines | [TEXT/ttxt] |
- --<<<
- -- Filename: TRANSITN.SX
-
- -- Other Files Required: (none)
-
- -- Purpose: To demonstrate how transitions work
-
- -- Specialized Classes: (none)
-
- -- Instructions to User: Load this file; first it displays a red square.
- -- Watch the white oval appear, wiping into view from left to right
-
- -- Author: Douglas Kramer
-
- ------------------------------------------------------------------------
-
- -- Set up a window
- global myWindow := new Window boundary:(new Rect x2:400 y2:400)
- myWindow.y := 40
- show myWindow
-
- -- Create a red rectangle
- global redBrush := new Brush color:redColor pattern:blackPattern
- global myRect := new TwoDShape target:(new Rect x2:300 y2:300) fill:redBrush
- myRect.x := 50
- myRect.y := 50
- append myWindow myRect
-
- -- Create a white circle
- global myOval := new TwoDShape target:(new Oval x2:200 y2:200) \
- fill:whiteBrush stroke:blackBrush
- myOval.x := 100
- myOval.y := 100
-
- -- Make the transition
- global myWipe := new Wipe duration:30 direction:@right target:myOval \
- scale:30 useOffscreen:true
- myWipe.backgroundBrush := redBrush
- prepend myWindow myWipe
-
- -- Prepare to play, which creates the cached target
- playPrepare myWipe 1
-
- play myWipe
-
- --To play again, type: goToBegin myWipe
-